Provides a set of properties for use in managing the retention period of documents and tracking security changes made to the retention properties.
Example
The following example code demonstrates how to use the PurgeDocumentWithID method of the AMDocumentRepository objectto purge a list of documents. This example could be modified to present a list of documents for which the ExpirationDate property value has passed:
Private Sub cmdPurge_Click()
On Error GoTo eh
' Update the list
cmdList_Click
If lvDocs.ListItems.Count < 1 Then Exit Sub
Dim dr As IAMDocumentRepository13
Dim i As Long
Set dr = m_vaultLink.CreateVault
'Ask the user if the listed documents are to be purged
If MsgBox("Are you sure you want to purge all documents before: " & _
Calendar1.Value, vbYesNo, "Confirm") = vbYes Then
Screen.MousePointer = vbHourglass
' disable controls
cmdPurge.Enabled = False
cmdList.Enabled = False
Calendar1.Visible = False
For i = 1 To lvDocs.ListItems.Count
'Perform the purge on all listed documents
dr.PurgeDocumentWithID lvDocs.ListItems.Item(i).Key
lblNrDocs.Caption = i & " / " & lvDocs.ListItems.Count
DoEvents
' Commit transaction for each 30 documents
If (i Mod 30) = 0 Then
dr.ReOpen True
End If
Next
Screen.MousePointer = vbDefault
MsgBox "Done!", , "Document Purger"
End If
dr.CloseRepository True
Set dr = Nothing
cmdPurge.Enabled = True
cmdList.Enabled = True
Calendar1.Visible = True
Exit Sub
eh:
Screen.MousePointer = vbDefault
dr.CloseRepository
Set dr = Nothing
MsgBox "Failed: " & Err.Description, , "Document Purger"
End Sub